<?php
$triangle = array();
// Construction et remplissage du triangle
for($i = 1; $i <= 6; $i++){
    $triangle[$i] = array(1 => 1);
    for($j = 1; $j <= $i; $j++){
        $val = 1;
        if($j > 1 && $j < $i){
            $val = $triangle[$i-1][$j-1] + $triangle[$i-1][$j];
        }
        $triangle[$i][$j] = $val;
        echo $val .' ';
    }
    echo '<br>';
}
//var_dump($triangle);
